![]() |
In the following, we will show how to use PAT
Module Generator to generate a new model checker: The source code of this example can be
downloaded here. A modle language Simplified CSP (SCSP),
which is a small subset of CSP, is used as a running example for the purpose
of illustration. In SCSP, a process is constructed only by event prefixing
or interleaving. The syntax of SCSP is as follows: P = e -> P | P
||| P | Skip; (A).
Generate Code with Module Generator With the Module Generator, it is very
convenient and simple to generate the code for a SCSP model checker as
illustrated by the following figure. Once the code generation is completed, the
following dialogue will appear to inform you. Now you can open the Windows Explorer to locate
the generated C# project: (B).
Complete the generated code Double click PAT3
Source.sln and you will open the C# solution in Microsoft Visual
Studio. In the generated solution, there are two
projects: (C).
Executing and testing the new model checker Editing a SCSP model in the
editor: Simulating it: Verifying it:
(A). Generate Code with Module
Generator
(B).
Complete the generated code
(C). Executing and testing the new model
checker
Note: no
modification is required here, unless one want to re-implement the editor.
Note that the parser classes are not generated
automatically. Thus, one needs to create parser classes manually,
e.g., SCSPTreeLexer.cs, SCSPTreeParser.cs, and
SCSPTreeWalker.cs.
Besides, there are two classes that are created
for specific purposes.
The rest
of classes in LTS are all language construct representations, including
Definition, DefinitionRef, EventPrefix, Interleave, Process, Skip and Stop.
Make sure that proper instances are created by the parser based on
a certain input model.